<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Rule extends CI_Controller {

	function __construct(){
		parent::__construct();
		if(!$this->auth->checkLogin()) redirect('user/login');
	}
	
	function index(){
		
		if($this->input->post('accept')){
			$this->load->model('User_model');
			$result = $this->User_model->setAcceptFlg( '1' ,$this->session->userdata('User_id'));
			if($result){
				$this->session->set_userdata(array('Accept_flg' => '1'));
				redirect('home/index');
			}
		}
		if($this->input->post('deaccept')){
			redirect('about/index');
		}
		// Render view
		$this->template->write_view('content', 'rule/index');
		$this->template->render();
	}
}